package org.wkg.lesson09;

import java.util.concurrent.TimeUnit;

public class Demo_904 {

    public static void main(String[] args) throws InterruptedException {
        MyThreadPool02 threadPool = new MyThreadPool02(3);
        for (int i = 0; i < 10; i++) {
            int task = i + 1;
            threadPool.schule(() -> {
                System.out.println("任务数：" + task + " " + Thread.currentThread().getName());
            });
            if (task % 2 == 0) {
                TimeUnit.SECONDS.sleep(1);
            }
        }
    }
}
